import Vuex from 'vuex';
import VuexPersistence from 'vuex-persist';
import initialState from './state';
import actions from './actions';
import mutations from './mutations';

const vuexLocal = new VuexPersistence({
    storage: window.localStorage,
});

const store = new Vuex.Store({
    state() {
        return initialState;
    },
    mutations,
    actions,
    plugins: [vuexLocal.plugin],
});

export default store;
